package com.ruoyi.project.good.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.good.mapper.GoodsForwardRecordMapper;
import com.ruoyi.project.good.domain.GoodsForwardRecord;
import com.ruoyi.project.good.service.IGoodsForwardRecordService;

/**
 * 商品转发Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-07-01
 */
@Service
public class GoodsForwardRecordServiceImpl implements IGoodsForwardRecordService 
{
    @Autowired
    private GoodsForwardRecordMapper goodsForwardRecordMapper;

    /**
     * 查询商品转发
     * 
     * @param forwardId 商品转发ID
     * @return 商品转发
     */
    @Override
    public GoodsForwardRecord selectGoodsForwardRecordById(Long forwardId)
    {
        return goodsForwardRecordMapper.selectGoodsForwardRecordById(forwardId);
    }

    /**
     * 查询商品转发列表
     * 
     * @param goodsForwardRecord 商品转发
     * @return 商品转发
     */
    @Override
    public List<GoodsForwardRecord> selectGoodsForwardRecordList(GoodsForwardRecord goodsForwardRecord)
    {
        return goodsForwardRecordMapper.selectGoodsForwardRecordList(goodsForwardRecord);
    }

    /**
     * 新增商品转发
     * 
     * @param goodsForwardRecord 商品转发
     * @return 结果
     */
    @Override
    public int insertGoodsForwardRecord(GoodsForwardRecord goodsForwardRecord)
    {
        goodsForwardRecord.setCreateTime(DateUtils.getNowDate());
        return goodsForwardRecordMapper.insertGoodsForwardRecord(goodsForwardRecord);
    }

    /**
     * 修改商品转发
     * 
     * @param goodsForwardRecord 商品转发
     * @return 结果
     */
    @Override
    public int updateGoodsForwardRecord(GoodsForwardRecord goodsForwardRecord)
    {
        return goodsForwardRecordMapper.updateGoodsForwardRecord(goodsForwardRecord);
    }

    /**
     * 批量删除商品转发
     * 
     * @param forwardIds 需要删除的商品转发ID
     * @return 结果
     */
    @Override
    public int deleteGoodsForwardRecordByIds(Long[] forwardIds)
    {
        return goodsForwardRecordMapper.deleteGoodsForwardRecordByIds(forwardIds);
    }

    /**
     * 删除商品转发信息
     * 
     * @param forwardId 商品转发ID
     * @return 结果
     */
    @Override
    public int deleteGoodsForwardRecordById(Long forwardId)
    {
        return goodsForwardRecordMapper.deleteGoodsForwardRecordById(forwardId);
    }
}
